/* 全局样式 - 白色主调，蓝色点缀 */
:root {
    --primary-color: #3498db;    /* 主色调：蓝色 */
    --primary-light: #ebf5fd;    /* 浅蓝色背景 */
    --secondary-color: #2980b9;  /* 深蓝色 */
    --text-color: #333;          /* 文本颜色 */
    --light-gray: #f8f9fa;       /* 浅灰色 */
    --border-color: #e0e0e0;     /* 边框颜色 */
    --success-color: #2ecc71;    /* 成功色 */
    --warning-color: #f39c12;    /* 警告色 */
    --danger-color: #e74c3c;     /* 危险色 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #fff;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: var(--secondary-color);
}

/* 布局组件 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    flex: 1;
    padding: 0 15px;
}

/* 后台布局 */
.admin-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.sidebar {
    width: 220px;
    background-color: #fff;
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: all 0.3s;
    overflow-y: auto;
    height: 100%;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    font-size: 24px;
    color: var(--primary-color);
    font-weight: bold;
}

.sidebar-menu {
    padding: 15px 0;
}

.sidebar-menu-item {
    padding: 10px 20px;
    display: block;
    color: var(--text-color);
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-menu-item:hover, 
.sidebar-menu-item.active {
    background-color: var(--primary-light);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.sidebar-menu-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-left: 220px;
    padding: 0;
    transition: all 0.3s;
    position: relative;
    min-height: 100vh;
    width: calc(100% - 220px);
    overflow-x: hidden;
}

/* 头部导航 */
.header {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 990;
}

.header-title {
    font-size: 18px;
    font-weight: bold;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-name {
    margin-right: 15px;
}

/* 页面内容容器 */
.page-content {
    padding: 20px;
    overflow-x: hidden;
}

/* 卡片组件 */
.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    color: #fff;
}

.btn-secondary {
    background-color: var(--light-gray);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #e9ecef;
}

.btn-success {
    background-color: var(--success-color);
    color: #fff;
}

.btn-success:hover {
    background-color: #27ae60;
}

.btn-warning {
    background-color: var(--warning-color);
    color: #fff;
}

.btn-warning:hover {
    background-color: #f1c40f;
}

.btn-danger {
    background-color: var(--danger-color);
    color: #fff;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 20px;
    font-size: 16px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
}

.form-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: var(--light-gray);
    font-weight: bold;
}

.table tr:hover {
    background-color: var(--primary-light);
}

/* 分页样式 */
.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.pagination-item {
    margin: 0 2px;
}

.pagination-link {
    display: block;
    padding: 5px 12px;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 4px;
    text-align: center;
}

.pagination-link:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.pagination-link.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* 警告框 */
.alert {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 3px 7px;
    font-size: 12px;
    border-radius: 10px;
    color: #fff;
}

.badge-primary {
    background-color: var(--primary-color);
}

.badge-success {
    background-color: var(--success-color);
}

.badge-warning {
    background-color: var(--warning-color);
}

.badge-danger {
    background-color: var(--danger-color);
}

/* 工具类 */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-primary {
    color: var(--primary-color);
}

.text-success {
    color: var(--success-color);
}

.text-warning {
    color: var(--warning-color);
}

.text-danger {
    color: var(--danger-color);
}

.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }
.mt-5 { margin-top: 25px; }

.mr-1 { margin-right: 5px; }
.mr-2 { margin-right: 10px; }
.mr-3 { margin-right: 15px; }
.mr-4 { margin-right: 20px; }
.mr-5 { margin-right: 25px; }

.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }
.mb-5 { margin-bottom: 25px; }

.ml-1 { margin-left: 5px; }
.ml-2 { margin-left: 10px; }
.ml-3 { margin-left: 15px; }
.ml-4 { margin-left: 20px; }
.ml-5 { margin-left: 25px; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }

.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }

.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* 响应式设计 */
@media (max-width: 992px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar-logo {
        font-size: 18px;
    }
    
    .sidebar-menu-item span {
        display: none;
    }
    
    .sidebar-menu-item i {
        margin-right: 0;
    }
    
    .main-content {
        margin-left: 70px;
    }
}

@media (max-width: 768px) {
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .card-header > *:not(:first-child) {
        margin-top: 10px;
    }
}

/* 移动端专用样式 */
@media (max-width: 576px) {
    .row {
        flex-direction: column;
    }
    
    .col {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .d-sm-none {
        display: none !important;
    }
    
    .sidebar {
        width: 0;
        transform: translateX(-100%);
        box-shadow: 3px 0 10px rgba(0,0,0,0.1);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .sidebar.show {
        width: 220px;
        transform: translateX(0);
    }
    
    .mobile-nav-toggle {
        display: block;
    }
    
    .header {
        padding: 10px 15px;
    }
    
    .user-info {
        flex-direction: column;
        align-items: flex-end;
    }
    
    .user-name {
        margin-right: 0;
        margin-bottom: 5px;
        font-size: 14px;
    }
    
    .card {
        margin-left: 0;
        margin-right: 0;
        overflow-x: auto;
    }
    
    .table-responsive {
        border: 0;
    }
}

/* 动画效果 */
.fade-enter-active, .fade-leave-active {
    transition: opacity 0.3s;
}

.fade-enter, .fade-leave-to {
    opacity: 0;
}

/* 页面过渡动画 */
.slide-fade-enter-active, .slide-fade-leave-active {
    transition: all 0.3s;
}

.slide-fade-enter, .slide-fade-leave-to {
    transform: translateX(30px);
    opacity: 0;
}

/* 针对用户中心的手机端优化 */
.user-center {
    max-width: 500px;
    margin: 0 auto;
}

.user-center .card {
    border-radius: 12px;
    margin-bottom: 15px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background-color: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 1000;
}

.bottom-nav-item {
    flex: 1;
    padding: 10px 5px;
    text-align: center;
    color: var(--text-color);
}

.bottom-nav-item.active {
    color: var(--primary-color);
}

.bottom-nav-icon {
    display: block;
    font-size: 20px;
    margin-bottom: 2px;
}

.bottom-nav-text {
    font-size: 12px;
}

/* 修复布局问题的额外样式 */
body.sidebar-open {
    overflow: hidden;
}

.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .card-body {
        padding: 15px 10px;
    }
    
    .row > div[class^="col-"] {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .page-content {
        padding: 15px 10px;
    }
}

/* 修复内容区域滚动问题 */
@media screen and (max-height: 600px) {
    .sidebar {
        overflow-y: auto;
    }
    
    .main-content {
        overflow-y: auto;
    }
}

/* 改进卡片在内容区域的显示 */
.card {
    margin-bottom: 20px;
    width: 100%;
}

/* 改进表格显示 */
.table th, .table td {
    white-space: nowrap;
}

@media (min-width: 992px) {
    .table th, .table td {
        white-space: normal;
    }
} 